package LeetCode;

import java.util.Arrays;

/**
 * @Author Kechelle
 * @Date 2020/9/21 9:41
 * @Version 1.0
 */
public class Code88 {
    public static void merge(int[] nums1,int m,int[] nums2,int n){
        System.arraycopy(nums2,0,nums1,m,n);
        Arrays.sort(nums1);
        System.out.println(Arrays.toString(nums1));
    }

    public static void merge1(int[] nums1,int m,int[] nums2,int n){
        for (int i=m;i<m+n;i++){
            nums1[i] = nums2[i-m];
        }
        Arrays.sort(nums1);
        System.out.println(Arrays.toString(nums1));
    }

    public static void main(String[] args) {
        int[] nums1 = {1,2,3,0,0,0};
        int[] nums2 = {2,5,6};
        merge1(nums1,3,nums2,3);
    }
}
